Framework & CI/CD Questions
Purpose of This Documentβ
These questions focus on how Selenium UI automation fits into real frameworks and CI/CD pipelines. Interviewers use these to judge maturity, scalability thinking, and production readiness.
Scope is UI automation only (Selenium 4+). No API/DB deep dive.
Framework Design Questionsβ
Q1. What makes a Selenium framework scalable?β
Answer:
- Clear separation of page and test responsibility
- Stable locator strategy
- Centralized waits
- Reusable page actions
Q2. Where should waits be implemented?β
Answer: Inside page classes, not in test classes.
Q3. Should Page Objects return WebElements?β
Answer: No. Page Objects should expose behavior, not elements.
Q4. How do you reduce duplicate code in Selenium frameworks?β
Answer: By centralizing common UI actions inside page classes and utility layers.
CI/CD Related Questionsβ
Q5. Why do Selenium tests fail more in CI than locally?β
Answer: Because CI environments are slower, headless, and often run tests in parallel.
Q6. How do you make Selenium tests CI-friendly?β
Answer:
- Use headless mode
- Avoid Thread.sleep
- Use explicit waits
- Keep tests independent
Q7. What browser configuration changes are needed for CI?β
Answer:
- Headless execution
- Fixed window size
- Disable unnecessary browser UI
Parallel Execution Questionsβ
Q8. What issues appear during parallel execution?β
Answer:
- Shared test data conflicts
- Session leakage
- Race conditions
Q9. How do you design tests for parallel execution?β
Answer:
- Make tests stateless
- Isolate test data
- Avoid static/shared variables
Stability & Maintenanceβ
Q10. How do you handle flaky tests in CI?β
Answer: Identify root cause, fix synchronization or locators β never rely on retries.
Q11. Is retry logic a good solution?β
Answer: No. Retries hide real issues and reduce trust in automation.
Reporting & Debuggingβ
Q12. What artifacts help debug CI failures?β
Answer: Screenshots, logs, videos (if available), and timestamps.
Q13. How do you know if a failure is test-related or app-related?β
Answer: By analyzing consistency, logs, screenshots, and manual reproduction.
Common Interview Red Flags ββ
- Heavy use of Thread.sleep
- Blaming Selenium for flakiness
- No understanding of CI behavior
- Tight coupling of tests and UI
Strong Interview Signals β β
- Clear framework boundaries
- CI-first thinking
- Root-cause based debugging
- Selenium 4 awareness
Interview One-Liners π―β
- βCI exposes timing issues faster.β
- βStable tests come from good design, not retries.β
- βParallel execution demands isolation.β
Summaryβ
- Framework design impacts CI stability
- Selenium must be CI-aware
- Parallel execution exposes weaknesses
- Mature answers focus on design, not hacks